package org.penguin.study.bk.role.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.penguin.study.bk.base.api.UUIDEntity;
import org.penguin.study.bk.user.entity.User;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * @author chengyinghua
 */
@Data
@TableName("tbl_roles")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(title = "tbl_roles表对象", description = "角色信息")
public class Role extends UUIDEntity implements Serializable {

    @TableId
    @Schema(title = "角色主键")
    private String id;

    @NotBlank(message = "名称不能为空")
    private String name;

    private String description;

    @TableField(exist = false)
    private List<User> users;

    private String status;

}
